<!--
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/business/returnedmaterial/ReturnedMaterial.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/business/returnedmaterial/ReturnedMaterial.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Id',
                footer: "Foots",
                cnName: '返回料',
                name: 'returnedmaterial/ReturnedMaterial',
                url: "/ReturnedMaterial/",
                sortName: "CreateDate",
                foreignKey:null
            });
            const editFormFields = ref({"Name":"","ProductNo":"","Category":"","OrderFormId":"","Heat":"","Weight":"","State":"","Enable":""});
            const editFormOptions = ref([[{"dataKey":"产品列表","data":[],"title":"产品名称","field":"Name","type":"select"},
                               {"title":"产品编号","field":"ProductNo","disabled":true},
                               {"title":"生产编号（批次号）","field":"Category"}],
                              [{"title":"订单号","field":"OrderFormId","disabled":true},
                               {"title":"重量(KG)","field":"Weight","type":"decimal"},
                               {"title":"炉次号","required":true,"field":"Heat","disabled":true,"type":"number"}],
                              [{"dataKey":"返回料状态","data":[],"title":"状态","field":"State","type":"select"},
                               {"dataKey":"enable","data":[],"title":"是否使用","field":"Enable","type":"select"}]]);
            const searchFormFields = ref({"Name":"","ProductNo":"","Category":"","OrderFormId":"","State":"","Enable":""});
            const searchFormOptions = ref([[{"dataKey":"产品列表","data":[],"title":"产品名称","field":"Name"},{"title":"产品编号","field":"ProductNo"},{"title":"生产编号（批次号）","field":"Category"}],[{"title":"订单号","field":"OrderFormId"},{"dataKey":"返回料状态","data":[],"title":"状态","field":"State","type":"select"},{"dataKey":"enable","data":[],"title":"是否使用","field":"Enable","type":"select"}]]);
            const columns = ref([{field:'Id',title:'主键',type:'string',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'Name',title:'产品名称',type:'string',bind:{ key:'产品列表',data:[]},width:110,align:'left',sort:true},
                       {field:'ProductNo',title:'产品编号',type:'string',link:true,width:110,readonly:true,align:'left'},
                       {field:'Category',title:'生产编号（批次号）',type:'string',width:110,align:'left'},
                       {field:'OrderFormId',title:'订单号',type:'string',width:150,readonly:true,align:'left'},
                       {field:'Heat',title:'炉次号',type:'int',width:80,readonly:true,require:true,align:'left'},
                       {field:'HeatNo',title:'炉号',type:'string',width:100,align:'left'},
                       {field:'InspectionItems',title:'检化验项（备用）',type:'string',width:180,hidden:true,align:'left'},
                       {field:'Weight',title:'重量(KG)',type:'decimal',width:110,align:'left'},
                       {field:'State',title:'状态',type:'int',bind:{ key:'返回料状态',data:[]},width:80,align:'left'},
                       {field:'Enable',title:'是否使用',type:'int',bind:{ key:'enable',data:[]},width:110,align:'left'},
                       {field:'CreateUserName',title:'添加人',type:'string',width:110,align:'left'},
                       {field:'CreateUserId',title:'添加人ID',type:'string',width:110,hidden:true,align:'left'},
                       {field:'CreateDate',title:'添加时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'ModifyUserName',title:'修改人',type:'string',width:110,align:'left'},
                       {field:'ModifyUserId',title:'修改人ID',type:'string',width:110,hidden:true,align:'left'},
                       {field:'ModifyDate',title:'修改时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'DeletionFlag',title:'删除标识',type:'int',width:110,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
